]> git.saurik.com Git - apple/libdispatch.git/blob - examples/Dispatch Samples/ReadMe.txt
libdispatch-84.5.tar.gz
[apple/libdispatch.git] / examples / Dispatch Samples / ReadMe.txt
1 ### DispatchProcessMonitor ###
2
3 ===========================================================================
4 DESCRIPTION:
5
6 Sample code showing how to: monitor process, do file and network I/O,
7 create and manage timers, and use dispatch_apply
8
9 ===========================================================================
10 BUILD REQUIREMENTS:
11
12 Mac OS X version 10.6 Snow Leopard
13
14 ===========================================================================
15 RUNTIME REQUIREMENTS:
16
17 Mac OS X version 10.6 Snow Leopard
18
19 ===========================================================================
20 PACKAGING LIST:
21
22 apply.c - dispatch_apply examples
23 netcat.c - network I/O examples
24 nWide.c - use of dispatch_semaphore to limit number of in-flight blocks
25 proc.c - process monitoring example
26 readFile.c - file I/O examples
27 readFileF.c - file I/O examples without Blocks
28 timers.c - create and manage timers
29
30 ===========================================================================
31 SAMPLE USAGE:
32
33 dispatch-apply
34
35 dispatch-apply takes no arguments. When run it will display some status
36 messages and timing information.
37
38 dispatch-netcat
39
40 Open two terminal windows. In one window run the "server":
41
42 cat ReadMe.txt | dispatch-netcat -l localhost 5050
43
44 In the other run the "client":
45
46 dispatch-netcat localhost 5050
47
48 Your server will send the contents of ReadMe.txt to the client, the server
49 will close it's connection and exit. The client will display whatever
50 the server sent (the ReadMe.txt file). See the main function in netcat.c
51 for more options.
52
53 dispatch-nWide
54
55 dispatch-nWide takes no arguments. When run it will display explanatory
56 text.
57
58 dispatch-proc
59
60 dispatch-proc takes no arguments. When run it will display output from
61 some processes it runs, and it will display information from the
62 process lifecycle events dispatch generates.
63
64 dispatch-readFile
65
66 Run dispatch-readFile with a filename as an argument:
67
68 dispatch-readFile ReadMe.txt
69
70 It will read the file 10 (or fewer) bytes at a time and display how many
71 bytes dispatch thinks are remaining to read.
72
73 dispatch-readFileF
74
75 Exactly the same as dispatch-readFile, but written without the use of Blocks.
76
77 dispatch-timers
78
79 dispatch-timers takes no arguments, running it display timer ticks for
80 a timer with an initial interval of one second, changing to one half second
81 after the first three events. It will exit after six events.
82
83 ===========================================================================
84 CHANGES FROM PREVIOUS VERSIONS:
85
86 Version 1.1
87 - Updated to current libdispatch API, and added samples readFileF.c and
88 nWide.c
89 Version 1.0
90 - First version
91
92 ===========================================================================
93 Copyright (C) 2009 Apple Inc. All rights reserved.